package st.business.tepth.business.goods;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import st.business.tepth.R;
import st.business.tepth.business.bean.ConsumableBean;

/**
 * @author zhangyu
 * @date 2019/2/25
 */
public class GoodsAdapter extends BaseQuickAdapter<ConsumableBean, BaseViewHolder> {
    public GoodsAdapter(int layoutResId, @Nullable List<ConsumableBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ConsumableBean item) {
        helper.setText(R.id.tv_name, item.getMaterial_name());
        helper.setText(R.id.tv_brand, "品牌：" + item.getBrand());
        helper.setText(R.id.tv_version, "型号：" + item.getMaterial_no());
        helper.setText(R.id.tv_specification, "规格：" + item.getSpecifications());
        helper.setText(R.id.tv_shelf_number, "自编号：" + item.getInner_no());

        helper.setText(R.id.tv_surplus_count, "");
        helper.addOnClickListener(R.id.tv_add_to_apply);
        helper.addOnClickListener(R.id.tv_apply_goods);
    }
}
